<?xml version="1.0" encoding="GB2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output indent="yes" method="xml" encoding="GB2312"/>
	
	<xsl:param name="category"/>

	<xsl:template match = "viewentries" > 
		<xsl:variable name="pos">
			<xsl:value-of select="//viewentry[./entrydata/text/text()=$category]/@position"/>
		</xsl:variable>
		<viewentries > 
			<xsl:copy-of select="//viewentry[starts-with(@position,concat($pos,'.'))]"/>
		</viewentries> 
	</xsl:template> 

</xsl:stylesheet>